package org.example.steamshop.repository;

import org.example.steamshop.model.Game;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface GameRepository extends JpaRepository<Game, Long> {
    // 添加状态条件
    Page<Game> findByNameLikeAndStatus(String keyword, String status, Pageable pageable);
    Page<Game> findByCategoryAndStatus(String category, String status, Pageable pageable);
    Page<Game> findByStatus(String status, Pageable pageable); // 新增方法


    // 原有管理后台方法保持不变
    List<Game> findByStatus(String status);

    Page<Game> findByNameLike(String keyword,Pageable pageable);

    boolean existsByName(String name);



}